﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbRapidRTRenderSettings : OdDbRenderSettings
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbRapidRTRenderSettings(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbRapidRTRenderSettings_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbRapidRTRenderSettings obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbRapidRTRenderSettings()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbRapidRTRenderSettings(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbRapidRTRenderSettings cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbRapidRTRenderSettings_cast(OdRxObject.getCPtr(pObj));
			OdDbRapidRTRenderSettings result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbRapidRTRenderSettings)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbRapidRTRenderSettings)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbRapidRTRenderSettings)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbRapidRTRenderSettings_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbRapidRTRenderSettings_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbRapidRTRenderSettings_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbRapidRTRenderSettings createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbRapidRTRenderSettings_createObject();
			OdDbRapidRTRenderSettings result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbRapidRTRenderSettings)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbRapidRTRenderSettings)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbRapidRTRenderSettings)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setRenderTarget(OdDbRapidRTRenderSettings.RenderTarget target)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setRenderTarget(this.swigCPtr, (int)target);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbRapidRTRenderSettings.RenderTarget renderTarget()
		{
			OdDbRapidRTRenderSettings.RenderTarget result = (OdDbRapidRTRenderSettings.RenderTarget)TD_DbPINVOKE.OdDbRapidRTRenderSettings_renderTarget(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setRenderLevel(int level)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setRenderLevel(this.swigCPtr, level);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int renderLevel()
		{
			int result = TD_DbPINVOKE.OdDbRapidRTRenderSettings_renderLevel(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setRenderTime(int time)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setRenderTime(this.swigCPtr, time);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int renderTime()
		{
			int result = TD_DbPINVOKE.OdDbRapidRTRenderSettings_renderTime(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setLightingModel(OdGiLightingMode mode)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setLightingModel(this.swigCPtr, (int)mode);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiLightingMode lightingModel()
		{
			OdGiLightingMode result = (OdGiLightingMode)TD_DbPINVOKE.OdDbRapidRTRenderSettings_lightingModel(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setFilterType(OdGiFilterType type)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setFilterType(this.swigCPtr, (int)type);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiFilterType filterType()
		{
			OdGiFilterType result = (OdGiFilterType)TD_DbPINVOKE.OdDbRapidRTRenderSettings_filterType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setFilterWidth(float width)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setFilterWidth(this.swigCPtr, width);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public float filterWidth()
		{
			float result = TD_DbPINVOKE.OdDbRapidRTRenderSettings_filterWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setFilterHeight(float height)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setFilterHeight(this.swigCPtr, height);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public float filterHeight()
		{
			float result = TD_DbPINVOKE.OdDbRapidRTRenderSettings_filterHeight(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setFilterDimensions(float width, float height)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_setFilterDimensions(this.swigCPtr, width, height);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void filterDimensions(SWIGTYPE_p_float width, SWIGTYPE_p_float height)
		{
			TD_DbPINVOKE.OdDbRapidRTRenderSettings_filterDimensions(this.swigCPtr, SWIGTYPE_p_float.getCPtr(width), SWIGTYPE_p_float.getCPtr(height));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbRapidRTRenderSettings_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRapidRTRenderSettings_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbRapidRTRenderSettings_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual uint subSetAttributes(OdGiDrawableTraits pTraits)
		{
			uint result = TD_DbPINVOKE.OdDbRapidRTRenderSettings_subSetAttributes(this.swigCPtr, OdGiDrawableTraits.getCPtr(pTraits));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool IsEqual(OdDbRapidRTRenderSettings settings)
		{
			bool result = TD_DbPINVOKE.OdDbRapidRTRenderSettings_IsEqual(this.swigCPtr, OdDbRapidRTRenderSettings.getCPtr(settings));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum RenderTarget
		{
			krLevel,
			krTime,
			krInfinite
		}
	}
}
